	
	<div id="page-content">
			<div class="col-lg-12">
		        <div class="panel">
		            <div class="panel-heading">
		                <h3 class="panel-title" style="text-align: center;">
		                	#@installPJaxGoBackBtn()
		                	角色信息
		                </h3>
		            </div>
		            <form id="editForm" class="panel-body form-horizontal form-padding">
		                <div class="form-group">
		                    <label class="col-md-3 control-label">角色名称</label>
		                    <div class="col-md-9">
		                        <input type="text"  name="sysRole.name" class="form-control"  value="#(o?o.name:'')">
		                         <input type="hidden"  name="sysRole.id" class="form-control" value="#(o?o.id:'')">
		                        <small class="help-block">请输入角色名称</small>
		                    </div>
		                </div>
		                <div class="form-group">
		                    <label class="col-md-3 control-label">角色标识</label>
		                    <div class="col-md-9">
		                        <input type="text"  name="sysRole.key" class="form-control"  value="#(o?o.key:'')" >
		                        <small class="help-block">请输入角色标识</small>
		                    </div>
		                </div>
		                <div class="form-group">
		                    <label class="col-md-3 control-label">描述信息</label>
		                    <div class="col-md-9">
		                        <textarea name="sysRole.description" rows="9" class="form-control">#(o?o.description:'')</textarea>
		                        <small class="help-block">请输入描述信息</small>
		                    </div>
		                </div>
		                <div class="panel-footer">
		                    <div class="row">
		                        <div class="col-sm-9 col-sm-offset-3">
		                            <button class="btn btn-warning" type="reset">重置</button>
		                            <button class="btn btn-primary" type="submit" >保存</button>
		                        </div>
		                    </div>
		                </div>
		            </form>
		        </div>
		    </div>
	</div>
	<script>
		function save(){
			var data = common_ajax.ajaxFunc("/admin/sys/role/save", $('#editForm').serialize(), "json", null);
			if(data.success){
				pointLion.alertMsg("保存成功!" , "success" , "small" , function(){
					location.href = ctx+'/admin/sys/role/getListPage';//跳转到列表页
				});
			}
		}
		$(document).ready(function() {
			$('#editForm').bootstrapValidator({
	            fields: {
	            	"sysRole.name": {
	                    validators: {
	                        notEmpty: {
	                            message: '*角色名称不能为空'
	                        },
	                        stringLength: {/*长度提示*/
	                            max: 25,
	                            message: '*机构名称长度必须小于25'
	                        },
	                        remote: {
			                    message: '*该角色名已经存在！',
			                    url:ctx+'/admin/sys/role/validRoleName',
			                    delay:1000
			                }
	                    }
	                },
	                "sysRole.key": {
	                    validators: {
	                    	notEmpty: {
	                            message: '*角色标识不能为空'
	                        },
	                        stringLength: {/*长度提示*/
	                            max: 30,
	                            message: '*机构名称长度必须小于30'
	                        },
	                        remote: {
			                    message: '*该角色Key已经存在！',
			                    url:ctx+'/admin/sys/role/validRoleKey',
			                    delay:1000
			                }
	                    }
	                },
	                "sysRole.description": {
	                    validators: {
	                    	stringLength: {
	                            max: 2000,
	                            message: '*机构描述信息长度必须小于2000'
	                        }
	                    }
	                }
	            }
	        }).on("success.form.bv", function (e) {
	            save();
	            return false;//阻止表单跳转
	        });
		});
	</script>